﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Security.Cryptography;

namespace WebApplication1.Business
{
    public class App
    {
        public static void showMessage(Page page, Type type, string mess, bool b)
        {
            ScriptManager.RegisterStartupScript(page, type, "alert", "<script language='javascript'>alert('" + mess + "')</script>", b);
        }


        public static string Encrypt(string str)
        {
            string str_md5 = "";
            byte[] mang = System.Text.Encoding.UTF8.GetBytes(str);

            MD5CryptoServiceProvider my_md5 = new MD5CryptoServiceProvider();
            mang = my_md5.ComputeHash(mang);

            foreach (byte b in mang)
            {
                str_md5 += b.ToString("X2");
            }

            return str_md5;


        }
    }
}